﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using GameEngine;
using Tomers.WPF.Localization;

namespace Daphne.Forms
{
    /// <summary>
    /// Interaction logic for GameResult.xaml
    /// </summary>
    public partial class GameResult : Window
    {
        public GameResult()
        {
            InitializeComponent();
            uxClose.Click += new RoutedEventHandler(uxClose_Click);
        }

        void uxClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        public void SetGameResult(enumGameResult gameResult)
        {
            switch (gameResult)
            {
                case enumGameResult.WhiteWin:
                    uxGameResult.Content = GetTextValue("CTR_WhiteWin");
                    break;
                case enumGameResult.BlackWin:
                    uxGameResult.Content = GetTextValue("CTR_BlackWin");
                    break;
                case enumGameResult.Draw:
                    uxGameResult.Content = GetTextValue("CTR_Draw");
                    break;
                default:
                    uxGameResult.Content = "????";
                    break;
            }

        }

        private static string GetTextValue(string sKey)
        {
            const string keyValue = "Value";
            return LanguageContext.Instance.Dictionary.Translate<string>(sKey, keyValue);

        }

    }
}
